<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>添加英雄</title>
</head>
<body>

<form class="layui-form" lay-filter="layui-form">
    <div class="mainBox">
        <div class="main-container">
            <div class="main-container">
                <blockquote class="layui-elem-quote">基础信息</blockquote>
                <div class="layui-form-item">
                    <label class="layui-form-label"><text title="必填项" style="color:red;">*</text>英雄名称</label>
                    <div class="layui-input-block">
                        <input type="text"  name="name" lay-verify="required" autocomplete="off" placeholder="请输入英雄名称" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><text title="必填项" style="color:red;">*</text>英雄游戏内部ID</label>
                    <div class="layui-input-block">
                        <input type="text"  name="hero_id" lay-verify="required" autocomplete="off" placeholder="请输入英雄内部id" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><text title="必填项" style="color:red;">*</text>称号</label>
                    <div class="layui-input-block">
                        <input type="text"  name="nickname" lay-verify="required" autocomplete="off" placeholder="请输入称号" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><text title="必填项" style="color:red;">*</text>职责</label>
                    <div class="layui-input-block">
                        <div class="xmSelect"
                             data-name="type"
                             data-sourceType="route"
                             data-source="/admin.lol.hero/type"
                             data-textField="type"
                             data-valueField="type"
                             data-paging="true"
                             data-radio="true"
                             data-layVerify="required"
                             data-direction="down"
                        ></div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label"><text title="必填项" style="color:red;">*</text>难度</label>
                    <div class="layui-input-block">
                        <div class="xmSelect"
                             data-name="difficulty"
                             data-sourceType="route"
                             data-source="/admin.lol.hero/difficulty"
                             data-textField="difficulty"
                             data-valueField="difficulty"
                             data-paging="true"
                             data-radio="true"
                             data-layVerify="required"
                             data-direction="down"
                        ></div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><text title="必填项" style="color:red;">*</text>英雄半身图</label>
                    <div class="layui-input-block">
                        <div class="laytpUpload"
                             data-name="url"
                             data-dir="xm_game/lol/hero/url"
                             data-accept="image"
                             data-type="ali-oss"
                             data-layVerify="required"
                             data-showChoiceBtn="false"
                        ></div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label"><text title="必填项" style="color:red;">*</text>英雄头像</label>
                    <div class="layui-input-block">
                        <div class="laytpUpload"
                             data-name="icon"
                             data-dir="xm_game/lol/hero/icon"
                             data-accept="image"
                             data-type="ali-oss"
                             data-layVerify="required"
                             data-showChoiceBtn="false"
                        ></div>
                    </div>
                </div>
                <blockquote class="layui-elem-quote">最佳搭档</blockquote>
                <div class="layui-form-item">
                    <label class="layui-form-label"><text title="必填项" style="color:red;">*</text>搭档英雄1</label>
                    <div class="layui-input-inline">
                        <div class="xmSelect"
                             data-name="team[]"
                             data-sourceType="route"
                             data-source="/admin.lol.hero/index"
                             data-textField="name"
                             data-valueField="id"
                             data-paging="true"
                             data-radio="true"
                             data-layVerify="required"
                             data-direction="down"
                        ></div>
                    </div>
                    <label class="layui-form-label"><text title="必填项" style="color:red;">*</text>搭档英雄2</label>
                    <div class="layui-input-inline">
                        <div class="xmSelect"
                             data-name="team[]"
                             data-sourceType="route"
                             data-source="/admin.lol.hero/index"
                             data-textField="name"
                             data-valueField="id"
                             data-paging="true"
                             data-radio="true"
                             data-layVerify="required"
                             data-direction="down"
                        ></div>
                    </div>
                    <label class="layui-form-label"><text title="必填项" style="color:red;">*</text>搭档英雄3</label>
                    <div class="layui-input-inline">
                        <div class="xmSelect"
                             data-name="team[]"
                             data-sourceType="route"
                             data-source="/admin.lol.hero/index"
                             data-textField="name"
                             data-valueField="id"
                             data-paging="true"
                             data-radio="true"
                             data-layVerify="required"
                             data-direction="down"
                        ></div>
                    </div>
                </div>
                <blockquote class="layui-elem-quote">克制英雄</blockquote>
                <div class="layui-form-item">
                    <label class="layui-form-label">克制英雄1</label>
                    <div class="layui-input-inline">
                        <div class="xmSelect"
                             data-name="restraint[]"
                             data-sourceType="route"
                             data-source="/admin.lol.hero/index"
                             data-textField="name"
                             data-valueField="id"
                             data-paging="true"
                             data-radio="true"
                             data-direction="up"
                        ></div>
                    </div>
                    <label class="layui-form-label">克制英雄2</label>
                    <div class="layui-input-inline">
                        <div class="xmSelect"
                             data-name="restraint[]"
                             data-sourceType="route"
                             data-source="/admin.lol.hero/index"
                             data-textField="name"
                             data-valueField="id"
                             data-paging="true"
                             data-radio="true"
                             data-direction="up"
                        ></div>
                    </div>
                    <label class="layui-form-label">克制英雄3</label>
                    <div class="layui-input-inline">
                        <div class="xmSelect"
                             data-name="restraint[]"
                             data-sourceType="route"
                             data-source="/admin.lol.hero/index"
                             data-textField="name"
                             data-valueField="id"
                             data-paging="true"
                             data-radio="true"
                             data-direction="up"
                        ></div>
                    </div>
                </div>
                <blockquote class="layui-elem-quote">被克制英雄</blockquote>
                <div class="layui-form-item">
                    <label class="layui-form-label">被克制英雄1</label>
                    <div class="layui-input-inline">
                        <div class="xmSelect"
                             data-name="restrained[]"
                             data-sourceType="route"
                             data-source="/admin.lol.hero/index"
                             data-textField="name"
                             data-valueField="id"
                             data-paging="true"
                             data-radio="true"
                             data-direction="up"
                        ></div>
                    </div>
                    <label class="layui-form-label">被克制英雄2</label>
                    <div class="layui-input-inline">
                        <div class="xmSelect"
                             data-name="restrained[]"
                             data-sourceType="route"
                             data-source="/admin.lol.hero/index"
                             data-textField="name"
                             data-valueField="id"
                             data-paging="true"
                             data-radio="true"
                             data-direction="up"
                        ></div>
                    </div>
                    <label class="layui-form-label">被克制英雄3</label>
                    <div class="layui-input-inline">
                        <div class="xmSelect"
                             data-name="restrained[]"
                             data-sourceType="route"
                             data-source="/admin.lol.hero/index"
                             data-textField="name"
                             data-valueField="id"
                             data-paging="true"
                             data-radio="true"
                             data-direction="up"
                        ></div>
                    </div>
                </div>
                <!--<div class="layui-form-item">
                    <blockquote class="layui-elem-quote">皮肤</blockquote>
                    <div class="layui-inline">
                        <label class="layui-form-label">
                            皮肤名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="skin_name1" autocomplete="off"
                                   placeholder="请输入英雄名称"
                                   class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-input-block">
                            <div class="laytpUpload"
                                 data-name="skin_url1"
                                 data-accept="image"
                                 data-type="ali-oss"
                                 data-showChoiceBtn="false"
                            ></div>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">
                            皮肤名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="skin_name2" autocomplete="off"
                                   placeholder="请输入英雄名称"
                                   class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-input-block">
                            <div class="laytpUpload"
                                 data-name="skin_url2"
                                 data-accept="image"
                                 data-type="ali-oss"
                                 data-showChoiceBtn="false"
                            ></div>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">
                            皮肤名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="skin_name3" autocomplete="off"
                                   placeholder="请输入英雄名称"
                                   class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-input-block">
                            <div class="laytpUpload"
                                 data-name="skin_url3"
                                 data-accept="image"
                                 data-type="ali-oss"
                                 data-showChoiceBtn="false"
                            ></div>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">
                            皮肤名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="skin_name4" autocomplete="off"
                                   placeholder="请输入英雄名称"
                                   class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-input-block">
                            <div class="laytpUpload"
                                 data-name="skin_url4"
                                 data-accept="image"
                                 data-type="ali-oss"
                                 data-showChoiceBtn="false"
                            ></div>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">
                            皮肤名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="skin_name5" autocomplete="off"
                                   placeholder="请输入英雄名称"
                                   class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-input-block">
                            <div class="laytpUpload"
                                 data-name="skin_url5"
                                 data-accept="image"
                                 data-type="ali-oss"
                                 data-showChoiceBtn="false"
                            ></div>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">
                            皮肤名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="skin_name6" autocomplete="off"
                                   placeholder="请输入英雄名称"
                                   class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-input-block">
                            <div class="laytpUpload"
                                 data-name="skin_url6"
                                 data-accept="image"
                                 data-type="ali-oss"
                                 data-showChoiceBtn="false"
                            ></div>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">
                            皮肤名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="skin_name7" autocomplete="off"
                                   placeholder="请输入英雄名称"
                                   class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-input-block">
                            <div class="laytpUpload"
                                 data-name="skin_url7"
                                 data-accept="image"
                                 data-type="ali-oss"
                                 data-showChoiceBtn="false"
                            ></div>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">
                            皮肤名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="skin_name8" autocomplete="off"
                                   placeholder="请输入英雄名称"
                                   class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-input-block">
                            <div class="laytpUpload"
                                 data-name="skin_url8"
                                 data-accept="image"
                                 data-type="ali-oss"
                                 data-showChoiceBtn="false"
                            ></div>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">
                            皮肤名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="skin_name9" autocomplete="off"
                                   placeholder="请输入英雄名称"
                                   class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-input-block">
                            <div class="laytpUpload"
                                 data-name="skin_url9"
                                 data-accept="image"
                                 data-type="ali-oss"
                                 data-showChoiceBtn="false"
                            ></div>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">
                            皮肤名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="skin_name10" autocomplete="off"
                                   placeholder="请输入英雄名称"
                                   class="layui-input">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <div class="layui-input-block">
                            <div class="laytpUpload"
                                 data-name="skin_url10"
                                 data-accept="image"
                                 data-type="ali-oss"
                                 data-showChoiceBtn="false"
                            ></div>
                        </div>
                    </div>
                </div>-->

            </div>
        </div>
    </div>
    <div class="bottom">
        <div class="button-container">
            <button type="submit" class="laytp-btn laytp-btn-primary laytp-btn-sm" lay-submit="" lay-filter="add">
                <i class="layui-icon layui-icon-ok"></i>
                提交
            </button>
            <button type="reset" class="laytp-btn laytp-btn-sm">
                <i class="layui-icon layui-icon-refresh"></i>
                重置
            </button>
        </div>
    </div>
</form>
<script>
    if(localStorage.getItem("staticDomain")){
        document.write("<link rel='stylesheet' href='" + localStorage.getItem("staticDomain") + "/component/layui/css/layui.css?v=" + localStorage.getItem("version") + "'>");
        document.write("<script src='" + localStorage.getItem("staticDomain") + "/component/layui/layui.js?v="+localStorage.getItem("version")+"'><\/script>");
        document.write("<script src='" + localStorage.getItem("staticDomain") + "/component/laytp/layuiConfig.js?v="+localStorage.getItem("version")+"'><\/script>");
        document.write("<script src='" + localStorage.getItem("staticDomain") + "/component/jquery_3.3.1.js?v="+localStorage.getItem("version")+"'><\/script>");
        document.write("<script src='" + localStorage.getItem("staticDomain") + "/component/jquery.tablednd.js?v="+localStorage.getItem("version")+"'><\/script>");
    }else{
        document.write("<link rel='stylesheet' href='/static/component/layui/css/layui.css?v=" + localStorage.getItem("version") + "'>");
        document.write("<script src='/static/component/layui/layui.js?v="+localStorage.getItem("version")+"'><\/script>");
        document.write("<script src='/static/component/laytp/layuiConfig.js?v="+localStorage.getItem("version")+"'><\/script>");
        document.write("<script src='/static/component/jquery_3.3.1.js?v="+localStorage.getItem("version")+"'><\/script>");
        document.write("<script src='/static/component/jquery.tablednd.js?v="+localStorage.getItem("version")+"'><\/script>");
    }
</script>
<script>
    layui.use(['laytp'],function(){
        layui.form.on('submit(add)', function(data){
            var btnAnim = layui.button.load({elem:$(this)});
            facade.ajax({
                route:'/admin.lol.hero/add',
                data : data.field
            }).done(function(res){
                if(res.code === 0){
                    parent.layui.layer.close(parent.layui.layer.getFrameIndex(window.name));//关闭当前页
                    parent.layui.table.reload("laytp-table");
                }
                btnAnim.stop();
            }).fail(function(){
                btnAnim.stop();
            });
            return false;
        });
    })
</script>
</body>
</html>